package com.gwnet.shop.service.impl;

import com.gwnet.shop.domain.OrderGoods;
import com.gwnet.shop.mapper.OrderGoodsMapper;
import com.gwnet.shop.service.IOrderGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 订单货品Service业务层处理
 * 
 * @author zhangwanpeng
 * @date 2024-07-21
 */
@Service
public class OrderGoodsServiceImpl implements IOrderGoodsService
{
    @Resource
    private OrderGoodsMapper orderGoodsMapper;

    /**
     * 查询订单货品
     * 
     * @param id 订单货品主键
     * @return 订单货品
     */
    @Override
    public OrderGoods selectOrderGoodsById(Long id)
    {
        return orderGoodsMapper.selectOrderGoodsById(id);
    }

    /**
     * 查询订单货品列表
     * 
     * @param orderGoods 订单货品
     * @return 订单货品
     */
    @Override
    public List<OrderGoods> selectOrderGoodsList(OrderGoods orderGoods)
    {
        return orderGoodsMapper.selectOrderGoodsList(orderGoods);
    }

    /**
     * 新增订单货品
     * 
     * @param orderGoods 订单货品
     * @return 结果
     */
    @Override
    public int insertOrderGoods(OrderGoods orderGoods)
    {
        return orderGoodsMapper.insertOrderGoods(orderGoods);
    }

    /**
     * 修改订单货品
     * 
     * @param orderGoods 订单货品
     * @return 结果
     */
    @Override
    public int updateOrderGoods(OrderGoods orderGoods)
    {
        return orderGoodsMapper.updateOrderGoods(orderGoods);
    }

    /**
     * 批量删除订单货品
     * 
     * @param ids 需要删除的订单货品主键
     * @return 结果
     */
    @Override
    public int deleteOrderGoodsByIds(Long[] ids)
    {
        return orderGoodsMapper.deleteOrderGoodsByIds(ids);
    }

    /**
     * 删除订单货品信息
     * 
     * @param id 订单货品主键
     * @return 结果
     */
    @Override
    public int deleteOrderGoodsById(Long id)
    {
        return orderGoodsMapper.deleteOrderGoodsById(id);
    }
}
